API Documentation
Static Public Member Functions | List of all members
nkAstraeus::lua::nkMathsWrap::QuaternionWrapper Class Referencefinal

Wraps a nkMaths::Quaternion and offers functions for use in scripting. More...

Static Public Member Functions

static void updateEnvironment (nkScripts::Environment *env)
 
static void * constructor (const nkScripts::DataStack &stack)
 
static void destructor (void *toDestroy)
 
static nkScripts::OutputValue newQuat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getX (void *vector)
 
static nkScripts::OutputValue getY (void *vector)
 
static nkScripts::OutputValue getZ (void *vector)
 
static nkScripts::OutputValue getW (void *vector)
 
static nkScripts::OutputValue getAsEulerAngles (const nkScripts::DataStack &stack)
 
static void setX (const nkScripts::DataStack &stack)
 
static void setY (const nkScripts::DataStack &stack)
 
static void setZ (const nkScripts::DataStack &stack)
 
static void setW (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue transform (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue apply (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromAxisAngle (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromEuler (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue toString (const nkScripts::DataStack &stack)
 

Detailed Description

Wraps a nkMaths::Quaternion and offers functions for use in scripting.

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::updateEnvironment ( nkScripts::Environment env)
static

Updates a given environment and set it up to use all functions wrapped by this wrapper.

Parameters
envThe environment to set up.

◆ constructor()

static void* nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type.

local q = nkMaths.Quaternion.new() ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ destructor()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::destructor ( void *  toDestroy)
static

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ newQuat4()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::newQuat4 ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type. Will map to the quaternion 4-float constructor.

local t = nkMaths.Quaternion.newQuat4(x, y, z, w) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ getX()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::getX ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getX(), exposed as an attribute getter.

local d = q._x ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getY()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::getY ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getY(), exposed as an attribute getter.

local d = q._y ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getZ()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::getZ ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getZ(), exposed as an attribute getter.

local d = q._z ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getW()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::getW ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getW(), exposed as an attribute getter.

local d = q._w ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getAsEulerAngles()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::getAsEulerAngles ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaterion::getAsEulerAngles().

local e = q:getAsEulerAngles() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ setX()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setX ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setX(), exposed as an attribute setter.

q._x = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setY()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setY ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setY(), exposed as an attribute setter.

q._y = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setZ()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setZ ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setZ(), exposed as an attribute setter.

q._z = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setW()

static void nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setW ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setW(), exposed as an attribute setter.

q._w = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ transform()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::transform ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::transform().

q:applyToVec(v) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ apply()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::apply ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::apply().

q:applyToVec(v) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.
Remarks
This function differs from the C++ variant in the fact that it does not return the vector as a reference. This helps in avoiding ownership issues for new references returned.

◆ setFromAxisAngle()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setFromAxisAngle ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromAxisAngle().

q:setFromAxisAngle(axis, angle) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.
Remarks
This function differs from the C++ variant in the fact that it does not return the vector as a reference. This helps in avoiding ownership issues for new references returned.

◆ setFromEuler()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::setFromEuler ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromEuler().

q:setFromEuler(angles) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.
Remarks
This function differs from the C++ variant in the fact that it does not return the vector as a reference. This helps in avoiding ownership issues for new references returned.

◆ toString()

static nkScripts::OutputValue nkAstraeus::lua::nkMathsWrap::QuaternionWrapper::toString ( const nkScripts::DataStack stack)
static

Overrides the default string conversion function.

local s = tostring(q) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a string.

The documentation for this class was generated from the following file: